#pragma once
//????????????????
//????
/*????
* no: ???????????????
* next: ???????
*/
typedef class arcEdge{
public:
	int no;
	arcEdge* next;
	int weight;
}ArcEdge;

//????
typedef class {
public:
	int no;//?????
	char* name;
	ArcEdge* firstEdge;
}ArcNode;

//???????????
typedef class {
public:
	int nodeNum;
	int* visited;
	int edgeNum;
	ArcNode* node;
}ArcGraph;

//???????????
ArcGraph* createGraph(int num);
void releaseGraph(ArcEdge* graph);

//?????????
void initArcGraph(ArcGraph* graph, char* name[], int num);


//???
/*
x:??β????
y:???????
w:???
*/
void addEdge(ArcGraph* graph, int x, int y, int w);

void visitNode(ArcNode* node);

void DFS_ArcGraph(ArcGraph* graph, int v);
void BFS_ArcGraph(ArcGraph* graph, int v);